//
// Created by oz on 2018/1/12.
//
#include <jni.h>
#include "JNIHelper.h"

JNIEnv* GetEnv(JavaVM &vm)
{
    JNIEnv* env;

    if((&vm)->GetEnv((void**)&env, JNI_VERSION_1_6) != JNI_OK) {
        return NULL;
    }

    return  env;
}


void ThrowIOException(JNIEnv *&env, const char *msg)
{

    env->ThrowNew(env->FindClass("java/io/IOException"), msg);

}